package com.geo.result.controller;


import com.geo.result.domain.TCustomerInfo;
import com.geo.result.domain.TMateriApply;
import com.geo.result.service.TCustomerInfoService;
import com.sino.common.core.web.controller.BaseController;
import com.sino.common.core.web.domain.AjaxResult;
import com.sino.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/customer")
public class TCustomerInfoController extends BaseController {
    @Autowired
    TCustomerInfoService tCustomerInfoService;

    /**
     * 查询客户信息列表
     */
    @PreAuthorize("@ss.hasPermi('result:customer:list')")
    @GetMapping("/list")
    public TableDataInfo list(TCustomerInfo tCustomerInfo)
    {
        startPage();
        List<TCustomerInfo> list = tCustomerInfoService.selectTCustomerInfoList(tCustomerInfo);
        return getDataTable(list);
    }


    /**
     * 查询客户简要信息列表
     */
    @PreAuthorize("@ss.hasPermi('result:customer:list')")
    @GetMapping("/minilist")
    public TableDataInfo miniList(TCustomerInfo tCustomerInfo)
    {
        startPage();
        List<TCustomerInfo> list = tCustomerInfoService.selectTCustomerInfoMiniList(tCustomerInfo);
        return getDataTable(list);
    }




    /**
     * 获取客户详细信息
     */
    @PreAuthorize("@ss.hasPermi('result:materi:query')")
    @GetMapping(value = "/{guid}")
    public AjaxResult getInfo(@PathVariable("guid") String guid)
    {
        return AjaxResult.success(tCustomerInfoService.selectTCustomerInfoByGuid(guid));
    }

}
